<?php 


require '../dao/gamermanagerdao.php';
require '../controller/page.php';
session_start();
$gamerid=$_GET['gamerid'];
$jieid=$_GET['jieid'];
$suoid=$_GET['suoid'];
$dao=new gamermanagerdao();
$state=$dao->Chaxun2($jieid, $suoid);
$gamerlist=$dao->Chaxun($gamerid);

if(empty($gamerlist)) {
	$info="用户不存在";
}


?>

<!-- 显示数据方法1 -->
<form action="../controller/handout.php?con=gamermanage&action=gamerquery" method="post">
<label>用户名：</label>
<input type="text" name="gamerid"/>
<input type="submit"  value="查询"/>
</form>
<input id="return" type="button"  value="返回"/>
<table class="tab">
<tr class="tabbg">
	<td>用户ID</td>
	<td>用户名</td>
	<td>用户密码</td>
	<td>用户等级</td>
	<td>VIP等级</td>
	<td>金币</td>
	<td>状态</td>
	<td>是否锁定</td>
</tr>
<?php if(!empty($info)){echo $info; }
 foreach ($gamerlist as $item=>$gamer){ ?>
 <tr class="tabbgg">
	<?php foreach ($gamer as $i=>$value){?>
	<td><?php if($value=='解锁'){?>	 
	<a href="main.php?url=gamermanager.php&jieid=<?php echo $gamer['id']?>">解锁</a>
	<?php }
	else if($value=='锁定'){?>
	<a href="main.php?url=gamermanager.php&suoid=<?php echo $gamer['id']?>">锁定</a>
	<?php }
	  else { echo $value; }?>
	</td>
	<?php } ?>
</tr>
<?php }?>
</table>
<?php $page=new PageCtrl;
$page->echoPage();
 ?>
<div>
		<span>共 {$this->mes_rows}条记录</span>
		<span>共{$this->page_sum}页</span>
		<span>当前第 {$this->corrent_page}页</span>
		<span><a href='{$url}&page={$pagefront}'><button>上一页</button></a></span>
		<span><a href='{$url}&page={$pagenext}'><button>下一页</button></a></span>
		</div>
<script type="text/javascript" src="../jQuery/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
   $("#return").click(function(){
	   window.location.href="main.php?url=gamermanager.php";
   });
</script>
